//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package cn.javasm.service.base.impl;

import cn.javasm.mapper.base.MyMapper;
import cn.javasm.service.base.BaseService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseServiceImpl<T> implements BaseService<T> {
    @Autowired
    private MyMapper<T> mapper;

    public BaseServiceImpl() {
    }

    public List<T> list() {
        return this.mapper.selectList((Wrapper)null);
    }

    public List<T> search(QueryWrapper<T> queryWrapper) {
        return this.mapper.selectList(queryWrapper);
    }

    public T findById(Long id) {
        return this.mapper.selectById(id);
    }

    public int add(T t) {
        return this.mapper.insert(t);
    }

    public int update(T t) {
        return this.mapper.updateById(t);
    }

    public int deleteById(Long id) {
        return this.mapper.deleteById(id);
    }

    public int batchDeleteByIds(List<Long> ids) {
        return this.mapper.deleteBatchIds(ids);
    }
}
